/*
 * author      : 吴中勤 
 * date        : 2018/11/15
 * description : TODO
 */

package org.wzq.learn.port.consume.shop;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient(value = "shop-service", fallback = ShopClientFallback.class)
public interface ShopClient {

	// shop-center的 context-path=/shop
    @RequestMapping(method = RequestMethod.GET, value = "/shop/shops")
    List<ShopDTO> listShops();

    @RequestMapping(method = RequestMethod.POST, value = "/shop/shops/{shopId}", consumes = "application/json")
    ShopDTO update(@PathVariable("shopId") String shopId, @RequestBody ShopDTO shopDTO);
}
